package cn.ctodb.divination.domain;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * A Bysl.
 */
@Entity
@Table(name = "bysl")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "bysl")
public class Bysl implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "num")
    private Integer num;

    @Column(name = "yy")
    private String yy;

    @Column(name = "jx")
    private String jx;

    @Column(name = "ys")
    private String ys;

    @Lob
    @Column(name = "content")
    private String content;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getNum() {
        return num;
    }

    public Bysl num(Integer num) {
        this.num = num;
        return this;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public String getYy() {
        return yy;
    }

    public Bysl yy(String yy) {
        this.yy = yy;
        return this;
    }

    public void setYy(String yy) {
        this.yy = yy;
    }

    public String getJx() {
        return jx;
    }

    public Bysl jx(String jx) {
        this.jx = jx;
        return this;
    }

    public void setJx(String jx) {
        this.jx = jx;
    }

    public String getYs() {
        return ys;
    }

    public Bysl ys(String ys) {
        this.ys = ys;
        return this;
    }

    public void setYs(String ys) {
        this.ys = ys;
    }

    public String getContent() {
        return content;
    }

    public Bysl content(String content) {
        this.content = content;
        return this;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Bysl bysl = (Bysl) o;
        if (bysl.id == null || id == null) {
            return false;
        }
        return Objects.equals(id, bysl.id);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "Bysl{" +
            "id=" + id +
            ", num='" + num + "'" +
            ", yy='" + yy + "'" +
            ", jx='" + jx + "'" +
            ", ys='" + ys + "'" +
            ", content='" + content + "'" +
            '}';
    }
}
